<?php
$old_str = 'abc<!--codes_iframe-->123<!--/codes_iframe-->';
$pattern = '/<!--codes_iframe-->(.*)<!--\/codes_iframe-->/';
$new_str = preg_replace($pattern, '', $old_str);
echo $old_str . "\n";
echo $new_str . "\n";
?>